package com.corpdata.app.customer.dao;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;

import com.corpdata.app.customer.entity.VisitRecord;
import com.corpdata.core.base.BaseMapper;

/**
 *  持久层接口
 * @author wu
 * @email 64088839@qq.com
 * @date 2018-07-13 15:15:48
 * 
 */
public interface VisitRecordMapper extends BaseMapper<VisitRecord>{
	
	@Insert("<script>insert into visit_record " + 
			"		( " + 
			"			id,  " + 
			"			Fk_projectid,  " + 
			"			Fk_customer,  " + 
			"			Visit_user,  " + 
			"			Visit_date,  " + 
			"			Visit_Remarks,Fk_Sell_record,created" + 
			"		) " + 
			"		values " + 
			"<foreach collection=\"list\" item=\"t\" separator=\",\" >"+
			"		( " + 
			"			#{t.id},  " + 
			"			#{t.fkProjectid},  " + 
			"			#{t.fkCustomer},  " + 
			"			#{t.visitUser},  " + 
			"			#{t.visitDate},  " + 
			"			#{t.visitRemarks},#{t.fkSellRecord},#{t.created} " + 
			"		)</foreach></script>")
	int insertList(List<VisitRecord> recordList);

	@Delete("delete from visit_record where fk_customer=#{cusId}")
	int deleteByFkCUstomer(String cusId);
}
